package com.mright.step01.annotation;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ConsumerConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhaochuanzhen
 * @since 2022/2/10 11:42 下午
 */
@Configuration
@EnableDubbo(scanBasePackages = "com.mright.steo01.annotation")
@ComponentScan(value = {"com.mright.step01.annotation"})
public class ConsumerConfiguration {

    @Bean
    public ApplicationConfig applicationConfig() {
        return new ApplicationConfig("echo_annotation_consumer");
    }

    @Bean
    public ConsumerConfig consumerConfig() {
        return new ConsumerConfig();
    }

    @Bean
    public RegistryConfig registryConfig() {
        return new RegistryConfig("zookeeper://127.0.0.1:2181");
    }
}
